import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/admin/dashboard'
  },
  {
    path: '/admin',
    component: () => import('../views/admin/AdminLayout.vue'),
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('../views/admin/Dashboard.vue')
      },
      {
        path: 'users',
        name: 'Users',
        component: () => import('../views/admin/users/UserList.vue')
      },
      {
        path: 'user/:id',
        name: 'UserDetail',
        component: () => import('../views/admin/user/UserDetail.vue')
      },
      {
        path: 'user/add',
        name: 'UserAdd',
        component: () => import('../views/admin/user/UserDetail.vue')
      },
      {
        path: 'user/edit/:id',
        name: 'UserEdit',
        component: () => import('../views/admin/user/UserDetail.vue')
      },
      {
        path: 'shop',
        name: 'Shop',
        component: () => import('../views/admin/shop/ShopList.vue')
      },
      {
        path: 'shop/add',
        name: 'ShopAdd',
        component: () => import('../views/admin/shop/ShopDetail.vue')
      },
      {
        path: 'shop/detail/:id',
        name: 'ShopDetail',
        component: () => import('../views/admin/shop/ShopDetail.vue')
      },
      {
        path: 'shop/edit/:id',
        name: 'ShopEdit',
        component: () => import('../views/admin/shop/ShopDetail.vue')
      },
      {
        path: 'content',
        name: 'Content',
        component: () => import('../views/admin/content/ContentList.vue')
      },
      {
        path: 'content/add',
        name: 'ContentAdd',
        component: () => import('../views/admin/content/ContentDetail.vue')
      },
      {
        path: 'content/detail/:id',
        name: 'ContentDetail',
        component: () => import('../views/admin/content/ContentDetail.vue')
      },
      {
        path: 'content/edit/:id',
        name: 'ContentEdit',
        component: () => import('../views/admin/content/ContentDetail.vue')
      },
      {
        path: 'order/:id',
        name: 'OrderDetail',
        component: () => import('../views/admin/order/OrderDetail.vue')
      },
      {
        path: 'orders',
        name: 'Orders',
        component: () => import('../views/admin/order/OrderList.vue')
      },
      {
        path: 'analytics',
        name: 'Analytics',
        component: () => import('../views/admin/analytics/AnalyticsDashboard.vue')
      },
      {
        path: 'user-analytics',
        name: 'UserAnalytics',
        component: () => import('../views/admin/analytics/UserAnalytics.vue')
      },
      {
        path: 'content-analytics',
        name: 'ContentAnalytics',
        component: () => import('../views/admin/analytics/ContentAnalytics.vue')
      },
      {
        path: 'shop-analytics',
        name: 'ShopAnalytics',
        component: () => import('../views/admin/analytics/ShopAnalytics.vue')
      },
      {
        path: 'content-categories',
        name: 'ContentCategories',
        component: () => import('../views/admin/content/ContentCategories.vue')
      },
      {
        path: 'settings',
        name: 'Settings',
        component: () => import('../views/admin/Settings.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 